Repository navigation
fix(files): answer 499 instead of 500 when a client disconnects mid-serve - #9143
Merged
Merged
Conversation
…erve The file serve route catches its own errors, so an abort thrown after the client went away was logged at error and answered 500, bypassing the 499 classification withRouteHandler already applies. Rethrow when the request signal has aborted, in the outer catch and in the cloud and local read helpers that log before rethrowing.
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
There was a problem hiding this comment.
All reported issues were addressed across 2 files
Reply with feedback, questions, or to request a fix.
Turn on auto-fix | Re-trigger cubic
Contributor
[Medium impact] This PR appears safe to merge. SummaryFile-serving errors now reach the shared 499 response when the client has disconnected.
Reviews (1) · Last reviewed commit: "fix(files): answer 499 instead of 500 wh..." · Reviewed by Greptile |
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
errorand answered 500 — inflating 5xx counts with failures nobody sawrequest.signalhas aborted sowithRouteHandlerclassifies it as a 499 at info, same as every other route (and the existing pattern in the Shopify OAuth callback)errorbefore rethrowingType of Change
Testing
app/api/files/serve/[...path]/route.test.ts(13/13), biome,check:test-patterns,check:comment-hygiene; full suite/type-check/audits in CIChecklist
test-auditauthoring gate)🤖 Generated with Claude Code